<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MQTT C Client Libraries Internals: MQTT Client Library Internals</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="pahologo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MQTT C Client Libraries Internals
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="PageDoc"><div class="header">
  <div class="headertitle">
<div class="title">MQTT Client Library Internals </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>In the beginning there was one MQTT C client library, MQTTClient, as implemented in <a class="el" href="MQTTClient_8c.html" title="Synchronous API implementation.">MQTTClient.c</a> This library was designed to be easy to use for applications which didn't mind if some of the calls blocked for a while. For instance, the MQTTClient_connect call will block until a successful connection has completed, or a connection has failed, which could be as long as the "connection
timeout" interval, whose default is 30 seconds.</p>
<p>However in mobile devices and other windowing environments, blocking on the GUI thread is a bad thing as it causes the user interface to freeze. Hence a new API, MQTTAsync, implemented in MQTTAsync.c, was devised. There are no blocking calls in this library, so it is well suited to GUI and mobile environments, at the expense of some extra complexity.</p>
<p>Both libraries are designed to be sparing in the use of threads. So multiple client objects are handled by one or two threads, with a select call in <a class="el" href="Socket_8c.html#ab33a53c9fce80d5dfeb26426b157034a" title="Returns the next socket ready for communications as indicated by select.">Socket_getReadySocket()</a>, used to determine when a socket has incoming data. This API is thread safe: functions may be called by multiple application threads, with the exception of <a class="el" href="MQTTClient_8c.html#a8ad3d29864a9ca08202b0832e0f6678e" title="When implementing a single-threaded client, call this function periodically to allow processing of me...">MQTTClient_yield</a> and <a class="el" href="MQTTClient_8c.html#a4c2df88d00a3dadd510a8cb774739366" title="This function performs a synchronous receive of incoming messages.">MQTTClient_receive</a>, which are intended for single threaded environments only. </p>
</div></div><!-- PageDoc -->
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Oct 13 2023 18:02:53 for MQTT C Client Libraries Internals by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
